<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			#box {
				text-align: center;
			}
			#btn {
				margin: auto;
				width: 50px;
				line-height: 50px;
				background-color: #ddd;
				border-radius: 100%;
				cursor: pointer;
				color: #fff;
			}
		</style>
	</head>

	<body>
		<div id="box">
			<div id="btn">开</div>
			<img src="img/pic_bulboff.gif" alt="" />
		</div>
	</body>
	<script>
		var btn = document.getElementById("btn");
		var imgs = document.querySelector("img");
		btn.onclick = function() {
			if(this.innerHTML == "开") {
				imgs.src = "img/pic_bulbon.gif";
				this.innerHTML = "关";
				this.style.backgroundColor = "green";
			} else {
				imgs.src = "img/pic_bulboff.gif";
				this.innerHTML = "开";
				this.style.backgroundColor = "#ddd";
			}
		}
	</script>
</html>